<template>
  <view class="bind-device-container">
    <!-- 状态栏占位 -->
    <view class="status-bar" :style="{height: statusBarHeight + 'px'}"></view>
    
    <!-- 顶部导航栏 -->
    <view class="bind-navbar">
      <view class="navbar-content">
        <view class="nav-left" @click="goBack">
          <text class="back-icon">‹</text>
        </view>
        <text class="nav-title">绑定设备</text>
        <view class="nav-right">
          <view class="nav-action-btn">
            <text class="action-dots">⋯</text>
          </view>
          <view class="nav-action-btn">
            <text class="action-location">📍</text>
          </view>
        </view>
      </view>
    </view>

    <!-- 内容区域 -->
    <view class="content-area">
      <!-- 听诊宝设备卡片 -->
      <view class="device-card" @click="bindStethoscope">
        <view class="device-info">
          <text class="device-name">某品牌型号听诊宝</text>
          <view class="device-image">
            <view class="stethoscope-icon">🩺</view>
          </view>
        </view>
      </view>

      <!-- 训练仪设备卡片 -->
      <view class="device-card" @click="bindTrainer">
        <view class="device-info">
          <text class="device-name">某品牌型号训练仪</text>
          <view class="device-image">
            <view class="trainer-icon">📱</view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      statusBarHeight: 0
    }
  },
  
  onLoad() {
    this.getSystemInfo()
  },
  
  methods: {
    getSystemInfo() {
      const systemInfo = uni.getSystemInfoSync()
      this.statusBarHeight = systemInfo.statusBarHeight || 0
    },
    
    goBack() {
      uni.navigateBack()
    },
    
    bindStethoscope() {
      uni.navigateTo({
        url: '/pages/configGuide/index?deviceType=stethoscope'
      })
    },
    
    bindTrainer() {
      uni.navigateTo({
        url: '/pages/configGuide/index?deviceType=trainer'
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.bind-device-container {
  min-height: 100vh;
  background: #F5F5F5;
  position: relative;
}

.status-bar {
  background: #FFFFFF;
}

.bind-navbar {
  background: #FFFFFF;
  height: 88rpx;
  border-bottom: 1px solid #E5E5E5;
  
  .navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 32rpx;
    
    .nav-left {
      width: 60rpx;
      height: 60rpx;
      display: flex;
      align-items: center;
      justify-content: center;
      
      .back-icon {
        font-size: 48rpx;
        color: #333333;
        font-weight: bold;
      }
    }
    
    .nav-title {
      font-size: 36rpx;
      font-weight: bold;
      color: #333333;
    }
    
    .nav-right {
      display: flex;
      align-items: center;
      
      .nav-action-btn {
        width: 60rpx;
        height: 60rpx;
        background: rgba(0, 0, 0, 0.05);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 16rpx;
        
        .action-dots, .action-location {
          font-size: 24rpx;
          color: #666666;
        }
      }
    }
  }
}

.content-area {
  padding: 60rpx 32rpx;
}

.device-card {
  background: #FFFFFF;
  border-radius: 24rpx;
  padding: 60rpx 40rpx;
  margin-bottom: 40rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  
  .device-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    
    .device-name {
      font-size: 36rpx;
      font-weight: bold;
      color: #333333;
      margin-bottom: 40rpx;
    }
    
    .device-image {
      width: 200rpx;
      height: 200rpx;
      background: #F5F5F5;
      border-radius: 20rpx;
      display: flex;
      align-items: center;
      justify-content: center;
      
      .stethoscope-icon, .trainer-icon {
        font-size: 80rpx;
      }
    }
  }
}
</style> 